package com.lecyon.farm.controller;

import com.lecyon.farm.base.BaseRequestVo;
import com.lecyon.farm.entity.elasticsearch.SimpleGps;
import com.lecyon.farm.service.ISimpleGpsService;
import com.lecyon.farm.vo.query.QuerySimpleGpsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * @author Yao Zheng
 * @Date 2020/4/18 16:49
 */
@RestController
@RequestMapping("/simple-gps")
@Api(tags = "位置信息")
@ResponseBody
@CrossOrigin
public class SimpleGpsController {

    private ISimpleGpsService simpleGpsService;

    @Autowired
    public SimpleGpsController(ISimpleGpsService simpleGpsService) {
        this.simpleGpsService = simpleGpsService;
    }

    @ApiOperation(value = "查询列表(F0101)", notes = "查询列表(不分页)，author:YaoZheng")
    @PostMapping(value = "/getList")
    public List<SimpleGps> getPageList(@RequestBody @Valid BaseRequestVo<QuerySimpleGpsVo> vo) {
        QuerySimpleGpsVo queryCondition = vo.getEntity(QuerySimpleGpsVo.class);
        return simpleGpsService.getList(queryCondition);
    }
}
